#pragma once

#include <opencv2/opencv.hpp>
#include <iostream>
#include <ctime>
#include <string>
#include <fstream>
#include "utils.h"
#define N 9999

using namespace cv;
using namespace std;




class Preprocess_for_init {
public:
	Preprocess_for_init(string filepath):
			filepath_(filepath) {}
	
		
	Result Init(vector<cv::Mat>& transform_imgs, vector<Target_Box>& transform_boxes, Vector& init_base_target_size, Vector& init_sample_pos, float& init_target_scale, Vector& init_target_size, Vector& init_target_pos, cv::Mat img);

	cv::Mat sample_patch(Mat img, Vector sample_pos, Vector sample_size, Vector output_size, Box *sample_coords);

	static void SplitString(const std::string& s, std::vector<std::string>& v, const std::string& c);

	struct Target_Box get_iou_box(Vector target_pos, Vector target_size, Vector sample_pos, float sample_scale);

private:
		
	Result transform_image(Mat img, Target_Box init_box, vector<cv::Mat>& transform_imgs, vector<Target_Box>& transform_boxes);
	
	
		
	string filepath_;
	
	string imgpath_;

};